package cgq.bignerdranch.cgq;

import androidx.appcompat.app.AppCompatActivity;

import android.bignerdranch.cgq.R;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn1,btn2,btn3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn1 = findViewById(R.id.btn1);
        btn2 = findViewById(R.id.btn2);
        btn3 = findViewById(R.id.btn3);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        final int b1 = R.id.btn1;
        final int b2 = R.id.btn2;
        final int b3 = R.id.btn3;
        switch (v.getId()){
            case b1:{
                Intent intent = new Intent();
                intent.setClass(this, GravityActivity.class);
                startActivity(intent);
            }
            case b2:{
                Intent intent = new Intent();
                intent.setClass(this, LinearAccelActivity.class);
                startActivity(intent);
            }
            case b3:{
                Intent intent = new Intent();
                intent.setClass(this, AmbientActivity.class);
                startActivity(intent);
            }
        }
    }
}